Skip to content

Fix comprehensive test#85

Merged
r41k0u merged 6 commits into
masterfrom
fix/comprehensive-store-type-mismatch
Jun 1, 2026
Merged

Fix comprehensive test#85
r41k0u merged 6 commits into
masterfrom
fix/comprehensive-store-type-mismatch

Conversation

@r41k0u

@r41k0u r41k0u commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

r41k0u and others added 4 commits May 31, 2026 12:46
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@r41k0u r41k0u requested a review from Copilot June 1, 2026 06:29
@r41k0u r41k0u changed the title Fix/comprehensive store type mismatch Fix comprehensive test Jun 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses pointer/value type mismatches when preparing arguments for BPF helper calls, especially around map helpers, by normalizing pointer depth before storing values into scratch temporaries.

Changes:

  • Add pointer-depth normalization in get_or_create_ptr_from_arg() (dereference when the evaluated expression yields a deeper pointer than the expected type).
  • Pass expected_type=ir.IntType(64) into map helper argument preparation to drive consistent scratch-temp allocation.
  • Fix deref_to_depth() to correctly track the current type while dereferencing, preventing invalid extra dereferences.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
pythonbpf/helper/helper_utils.py Adds pointer-depth normalization before storing evaluated helper arguments into scratch temporaries.
pythonbpf/helper/bpf_helper_handler.py Provides expected_type to map helper arg preparation to avoid type mismatches during temp allocation/stores.
pythonbpf/expr/ir_ops.py Fixes dereference loop type-tracking in deref_to_depth() to stop dereferencing once the type is non-pointer.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread pythonbpf/helper/helper_utils.py Outdated
@r41k0u r41k0u force-pushed the fix/comprehensive-store-type-mismatch branch from 365746c to d0f7a9d Compare June 1, 2026 06:37
@r41k0u r41k0u merged commit 8c5069f into master Jun 1, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants